home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / game / shoot / athrust.lha / AmigaThrust / src / soundIt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-05  |  1.9 KB  |  53 lines

  1. /*
  2.  * Paula SoundIt library V0.1
  3.  * Written by Frank Wille, frank@phoenix.owl.de
  4.  *
  5.  * Amiga specific sound routines for Thrust,
  6.  * based on SoundIt library 0.04,
  7.  * Copyright 1994 Brad Pitzel  pitzel@cs.sfu.ca
  8.  *
  9.  */
  10.  
  11. #ifndef SOUNDIT_VERS
  12. #define SOUNDIT_VERS "0.1 (Amiga/Paula)"
  13.  
  14.  
  15. /*==========================================================================*/
  16. typedef struct {
  17.   unsigned char *data;  /* unsigned 8-bit raw samples (intel format) */
  18.   int len;              /* length of sample in bytes  */
  19.   int loop;             /* loop=0 : play sample once, */
  20.                         /* loop=1 : loop sample       */
  21.   unsigned char *cdata; /* signed 8-bit raw samples in Chip-RAM (Amiga) */
  22. } Sample;
  23.  
  24.  
  25. /*==========================================================================*/
  26. /* given the name of a .raw sound file, load it into the Sample struct */ 
  27. /* pointed to by 'sample'                                              */
  28. int Snd_loadRawSample(const char *file, Sample *sample, int loop);
  29.  
  30.  
  31. /*==========================================================================*/
  32. /* init sound device, etc..                                                 */
  33. /* num_snd  = the number of samples in the sample array *sa                 */
  34. /* sa       = the sample array                                              */
  35. /* freq     = the rate (Hz) to play back the samples                        */
  36. /* channels = # of channels to mix (no mixing on Amiga, max. 4 channels)    */
  37. /* sound_device = (ignored for Amiga version, always use audio.device)      */
  38. /* returns: 0=success, -1=failure.*/
  39. int Snd_init(int num_snd, Sample *sa, int freq, 
  40.              int channels, const char *sound_device);
  41.  
  42.  
  43. /* shutdown sample player, free mem, etc/etc..*/
  44. int Snd_restore(void);
  45.  
  46.  
  47. /* play a sound effect in the given channel 1..n*/
  48. /* volume = integers from 0 (off) to 100 (full volume)*/
  49. int Snd_effect(int nr, int channel);
  50.  
  51.  
  52. #endif
  53.